// 公用弹窗
import {ElMessage, ElMessageBox} from "element-plus";

const tips = class {
    constructor(message, type='success') {
        this.message = message;
        this.type = type;
    }

    // ElMessage 提示
    msg() {
        ElMessage({
            message: this.message,
            type: this.type,
            duration: 1500
        })
    }
    msgBox() {
        ElMessageBox.alert(this.message, '提示', {
            confirmButtonText: '确定',
            type: this.type
        }).then(res => {
            // 点击确定进入项
            console.log(err)
            window.location.href = '/'
        }).catch(err => {
            // 点击打叉按钮进入项
            console.log(err)
            window.location.href = '/'
        })
    }
}

export default tips